package com.ln.dm1031.demo04;

/**
 * @author Ln
 * @version 终极版
 * @date 2022/10/31 15:26
 */
public class HandsomeBoy implements Runnable{
    private BankCard bankCard;
    public HandsomeBoy(BankCard bankCard){
        this.bankCard=bankCard;
    }
    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            bankCard.setBalance(bankCard.getBalance()+5000);
            System.out.println(Thread.currentThread().getName()+"向卡中存入5000,卡中余额:"+bankCard.getBalance());
        }
    }
}
